package com.sm.honkon.ui.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.sm.honkon.R
import com.sm.honkon.data.bean.CustomerEntity

class CustomerAdapter(
    data: MutableList<CustomerEntity> = arrayListOf(),
    layoutResIdRes: Int = R.layout.item_customer
) :
    BaseQuickAdapter<CustomerEntity, BaseViewHolder>(layoutResIdRes, data) {


    override fun convert(helper: BaseViewHolder, item: CustomerEntity) {
        item.let {
            helper.apply {
                getView<TextView>(R.id.tv_number).text = it.uid.toString()
                getView<TextView>(R.id.tv_worknum).text = it.id
                getView<TextView>(R.id.tv_name).text = it.name
                getView<TextView>(R.id.tv_sex).text = it.sexShow
                getView<TextView>(R.id.tv_phone).text = it.mobile
                getView<TextView>(R.id.tv_handler).text = it.handleName
                getView<TextView>(R.id.tv_first_treatment_conetnt).text = it.first_treatment_conetnt
                getView<TextView>(R.id.tv_last_treatment_conetnt).text = it.last_treatment_conetnt
                getView<TextView>(R.id.tv_treatment_count).text = it.treatment_count.toString()
                getView<TextView>(R.id.tv_last_time).text = it.lastTime

            }
        }
    }

}